Skip to content

Refactor WebPageController to use IPriceController and ComparisonResult#59

Merged
lukepring merged 4 commits intoSprint-2-Jackfrom
copilot/sub-pr-55-yet-again
Mar 20, 2026
Merged

Refactor WebPageController to use IPriceController and ComparisonResult#59
lukepring merged 4 commits intoSprint-2-Jackfrom
copilot/sub-pr-55-yet-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 20, 2026

WebPageController duplicated chart coordinate logic already handled by ChartBuilder, and returned a loosely-typed Map<String, Object> instead of the existing ComparisonResult/ChartData domain types — diverging from the REST API path.

Changes

  • Replaced MarketDataService with IPriceController — the same interface used by PriceComparisonApiController, routing web requests through PriceComparisonServiceChartBuilder like the API does
  • Removed ~80 lines of manual chart calculation — min/max price scanning, coordinate mapping, SVG path building now delegated to ChartBuilder
  • Replaced Map<String, Object> result with ComparisonResult — strongly-typed domain object added directly to the Thymeleaf model; template property access already matched the getters
// Before
private final MarketDataService marketDataService;
// ... 80 lines of manual chart math ...
Map<String, Object> result = new HashMap<>();
result.put("chartData", chartData); // loosely typed

// After
private final IPriceController priceController;
// ...
ComparisonResult result = priceController.comparePrices(symbol1, symbol2, start, end);
model.addAttribute("result", result);

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: lukepring <68820847+lukepring@users.noreply.github.com>
Copilot AI changed the title [WIP] [WIP] Address feedback on Sprint 2 jack PR Refactor WebPageController to use IPriceController and ComparisonResult Mar 20, 2026
Copilot AI requested a review from lukepring March 20, 2026 15:51
@lukepring lukepring marked this pull request as ready for review March 20, 2026 16:00
@lukepring
Copy link
Copy Markdown
Owner

@copilot please review the conflict resolution i did to ensure code still runs as intended

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 20, 2026

@lukepring The model claude-sonnet-4.6 is not available for your account. This can happen if the model was disabled by your organization's policy or if your Copilot plan doesn't include access to it.

You can try again without specifying a model (just @copilot) to use the default, or choose a different model from the model picker.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: ed8c72e1-7935-4d8a-bed5-776a9ef47995

3 similar comments
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 20, 2026

@lukepring The model claude-sonnet-4.6 is not available for your account. This can happen if the model was disabled by your organization's policy or if your Copilot plan doesn't include access to it.

You can try again without specifying a model (just @copilot) to use the default, or choose a different model from the model picker.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: ed8c72e1-7935-4d8a-bed5-776a9ef47995

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 20, 2026

@lukepring The model claude-sonnet-4.6 is not available for your account. This can happen if the model was disabled by your organization's policy or if your Copilot plan doesn't include access to it.

You can try again without specifying a model (just @copilot) to use the default, or choose a different model from the model picker.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: ed8c72e1-7935-4d8a-bed5-776a9ef47995

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 20, 2026

@lukepring The model claude-sonnet-4.6 is not available for your account. This can happen if the model was disabled by your organization's policy or if your Copilot plan doesn't include access to it.

You can try again without specifying a model (just @copilot) to use the default, or choose a different model from the model picker.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: ed8c72e1-7935-4d8a-bed5-776a9ef47995

@lukepring
Copy link
Copy Markdown
Owner

@copilot @copilot please review the conflict resolution i did to ensure code still runs as intended

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 20, 2026

@lukepring The model claude-sonnet-4.6 is not available for your account. This can happen if the model was disabled by your organization's policy or if your Copilot plan doesn't include access to it.

You can try again without specifying a model (just @copilot) to use the default, or choose a different model from the model picker.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: ed8c72e1-7935-4d8a-bed5-776a9ef47995

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 20, 2026

@lukepring The model claude-sonnet-4.6 is not available for your account. This can happen if the model was disabled by your organization's policy or if your Copilot plan doesn't include access to it.

You can try again without specifying a model (just @copilot) to use the default, or choose a different model from the model picker.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: ed8c72e1-7935-4d8a-bed5-776a9ef47995

Co-authored-by: lukepring <68820847+lukepring@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 20, 2026

@copilot @copilot please review the conflict resolution i did to ensure code still runs as intended

Reviewed and fixed the merge regression in commit 38c290f: WebPageController now delegates to IPriceController.comparePrices, uses the typed ComparisonResult/ChartData, and the reintroduced manual chart math + Map have been removed. Local mvn compile passes; no UI changes.

@lukepring lukepring merged commit 23da9eb into Sprint-2-Jack Mar 20, 2026
@lukepring lukepring deleted the copilot/sub-pr-55-yet-again branch March 20, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants